﻿using ONetworkTalk.Core;
using ONetworkTalk.Handler;
using ONetworkTalk.Server;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace imService
{
    class Program
    {
        static void Main(string[] args)
 
       {
 
            //serverEngine.RunEngineAsync(,)
 
            Console.WriteLine("服务端启动！");
 
            TaskAsync().Wait();
 
        }
 
       static async Task TaskAsync()
 
       {
 

 
            OServerEngine serverEngine = new OServerEngine();
 
            UserManager userManager = new UserManager();
 
            BasicController basicController = new BasicController(userManager);
 
            BasicHandler basicHandler = new BasicHandler();
 
            CustomizeHandler customizeHandler = new CustomizeHandler();
 
            MessageDispatcher messageDispatcher = new MessageDispatcher(basicController, basicHandler, customizeHandler);
 
            ChannelServerHandler channelServerHandler = new ChannelServerHandler(userManager, messageDispatcher);
 
            await serverEngine.RunEngineAsync(5001, basicHandler, customizeHandler);
 
            Console.ReadLine();
 
            serverEngine.Close();
 
        }
    }
}
